package cn.demoxy.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @auther demo
 * @date 2022/5/9 21:03
 * 异常信息枚举类
 */
@Getter
@AllArgsConstructor
public enum ExceptionMessageEnum {
    FILE_SIZE_IS_MAX(501,"文件上传超出300M"),
    DATASOURCE_CONNECTION_TIME_OUT(502,"数据库连接超时"),
    UPLOAD_FILE_IS_NOT_NULL(503,"上传文件不能为空"),
    NO_LOGIN(401,"未登录或登录状态已过期,请登录"),
    NO_PERMISSION(403,"权限不足,无法访问"),
    USERNAME_IS_NOT_FOUND(406,"用户名不存在"),
    USER_IS_DISABLE(407,"该用户已被禁用,请联系管理员"),
    USER_IS_ONLINE(408,"该用户已在线,请勿重复登录")
  ;


    private String msg;
    private int code;

    ExceptionMessageEnum(int code,String msg)
    {
        this.code=code;
        this.msg=msg;
    }

    public String Msg()
    {
        return this.msg;
    }
    public int Code() {
        return this.code;
    }
}
